package com.base;

import java.util.*;

/**
 * @author: sun.hongliang
 * @create: 2019/06/28 15:33
 */
public class SortList {
    public static void main(String[] args) {
        List<Integer> arrayList = new ArrayList<Integer>(4000);
        List<Integer> linkList = new LinkedList<Integer>();
        Random random = new Random();
        for (int i = 0; i < 4000; i++) {
            final int ri = random.nextInt(100000);
            arrayList.add(ri);
            linkList.add(ri);
        }
        long t1 = System.currentTimeMillis();
        Collections.sort(arrayList);
        long t2 = System.currentTimeMillis();
        Collections.sort(linkList);
        long t3 = System.currentTimeMillis();
        System.out.println(t2 - t1);
        System.out.println(t3 - t2);
    }
}
